<h1 id="supervisord">supervisord</h1>
<p>配置后台服务/常驻进程的进程管家工具</p>
<h2 id="安装">安装</h2>
<div class="sourceCode" id="cb1"><pre><code class="language-bash"><a class="sourceLine" id="cb1-1" data-line-number="1"><span class="co"># 安装 supervisord</span></a>
<a class="sourceLine" id="cb1-2" data-line-number="2"><span class="ex">apt-get</span> install supervisor</a></code></pre></div>
<h2 id="实例">实例</h2>
<p>生成配置文件 <code>/etc/supervisord.conf</code></p>
<div class="sourceCode" id="cb2"><pre><code class="language-bash"><a class="sourceLine" id="cb2-1" data-line-number="1">[<span class="ex">program</span>:app]</a>
<a class="sourceLine" id="cb2-2" data-line-number="2"><span class="va">command=</span>/usr/bin/gunicorn <span class="ex">-w</span> 1 wsgiapp:application</a>
<a class="sourceLine" id="cb2-3" data-line-number="3"><span class="va">directory=</span>/srv/www</a>
<a class="sourceLine" id="cb2-4" data-line-number="4"><span class="va">user=</span>www-data</a></code></pre></div>
<p>supervisord: 启动 supervisor 服务</p>
<div class="sourceCode" id="cb3"><pre><code class="language-bash"><a class="sourceLine" id="cb3-1" data-line-number="1"><span class="ex">supervisorctl</span> start app</a>
<a class="sourceLine" id="cb3-2" data-line-number="2"><span class="ex">supervisorctl</span> stop app</a>
<a class="sourceLine" id="cb3-3" data-line-number="3"><span class="ex">supervisorctl</span> reload <span class="co"># 修改/添加配置文件需要执行这个</span></a></code></pre></div>
<h2 id="下载地址">下载地址</h2>
<p>https://pypi.python.org/pypi/meld3<br />
https://pypi.python.org/pypi/supervisor</p>
